
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;


public class snp {
	private String name;
	private Float raf;
	private String snp_RA;
	private HashMap<String, Float> traitOdds;
	
	public snp(){
		if(traitOdds == null)
		{
			traitOdds = new HashMap<String, Float>();
		}
	}
	
	public snp(String snp_name){
		name = snp_name;
		if(traitOdds == null)
		{
			traitOdds = new HashMap<String, Float>();
		}
	}
	
	public void setTraitOdds(String trait, Float odds){
		String t = "", tr = "";
		
		
		 tr = trait.replace('-', ' ').replace('.', ' ').replace('\'', ' ').replace('(', ' ')
		   .replace(')', ' ').replace(',' , ' ').replace('/', ' ').replace(' ', '_');
		 
		 if(tr.length() >= 30)
		   { 
			   t = tr.substring(0,29);
		   } 
		 else
		 {
			 t = tr;
		 }
		if (traitOdds != null && !traitOdds.containsKey(t)){
			
			traitOdds.put(t, odds);
		}
	}
	
	public void setRaf(Float snp_raf){
		raf = snp_raf;
	}
	
	public void setRA(String snp_ra){
		snp_RA = snp_ra;
	}
	
	public Float getSnpOdds(String trait){
		return traitOdds.get(trait);
	}

	public Float getRaf(){
		return raf;
	}
	
	public String getRA(){
		return snp_RA;
	}
	
	public String getName()
	{
		return name;
	}
	
	public Iterator<Map.Entry<String, Float>> getIterator() 
	{
	  	return traitOdds.entrySet().iterator();
	}
	public Float getSnpTraitLR(String trait)
	{
		return (traitOdds.get(trait));
	}
}

